package com.lichengGongshang.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by dl on 2015/11/19.
 */
public class Test {
    public static void main(String[] args){
        /*String str = "\"guestRemainNum\":114,\"seqno\":\"2\",\"voucherType\":101,\"berthId\":\"\",\"batchCode\":\"20151028\",\"actTime\":\"20151023112544\",\"platformId\":\"weishimo\",\"voucherNo\":\"\",\"carNumber\":\"沪AH0680\",\"uid\":\"400000010\",\"carType\":1,\"parkingSpotId\":\"shanghaidajiudian\",\"addBerth\":\"\",\"monthlyCertNumber\":\"\",\"bizSn\":\"20151119\",\"actType\":101," +
                "\"totRemainNum\":\"abc\",\"businessType\":1,\"monthlyRemainNum\":0,\"key\":\"45D62820-6994-4136-BAEC-D073598EA29E\"}";

        String str2 = "For input string: \"abc\"";
        str2 = str2.replace(" ","");
        int i = str2.indexOf(":");

        *//*System.out.println(i);*//*

        String str21 = str2.substring(i+1,str2.length());

        *//*System.out.println(str21);*//*

        int ii = str.indexOf(str21);

        *//*System.out.println(ii);
        System.out.println(str.length());*//*

        String str11 = str.substring(0,ii);

        System.out.println(str11);

        int iii = str11.lastIndexOf("\"");

        System.out.println(iii);

        String str111 = str11.substring(0,iii);

        System.out.println(str111);

        int iiii = str111.lastIndexOf("\"");

        System.out.println(str111.substring(iiii+1));*/
        /*Calendar calendar=Calendar.getInstance();
        calendar.setTime(new Date());
        System.out.println(calendar.get(Calendar.YEAR));//今天的日期
        System.out.println(calendar.get(Calendar.MONTH)+1);//今天的日期
        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));//今天的日期
        calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)+1);//让日期加1
        System.out.println(calendar.get(Calendar.DATE));//加1之后的日期Top*/

        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");

        Calendar c = Calendar.getInstance();
        c.add(Calendar.DATE, - 7);
        Date monday = c.getTime();
        String preMonday = sdf.format(monday);
        System.out.println(preMonday);

    }




}
